import 'package:flutter/material.dart';
import 'package:flutter_with_bmap/consts/msg_type.dart';
import 'package:flutter_with_bmap/mixins/sprite_bg.dart';

/// 信号灯相关得东西
class EventIcon extends StatefulWidget {
  final MsgType msgType;
  const EventIcon(this.msgType, {super.key});
  @override
  State<StatefulWidget> createState() => EventIconState();
}

class EventIconState extends State<EventIcon> with SpriteBg {
  //雪碧图里面每个图标的宽度数组
  @override
  String get assetName => "flutter_assets/images/scenes.png";
  @override
  List<double> get itemWidthList =>
      [110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110];
  @override
  double get iconHeight => 110;
  @override
  int get index => widget.msgType.index;
}
